<template>
	<div v-if="showGuide" class="xyMian toast" @touchmove.stop.prevent="moveHandleStop">
		<div class="xyMian_item">
			<view class="h1">隐私协议</view>
			<view class="text">
				请你务必审慎阅读、充分理解“隐私协议”各条款，包括不限于：为向您提供分享、导航等服务，让您更方便的使用App，我们需要收集您的设备信息、获取定位、拨打电话等应用授权。
				您可以阅读<view class="xy" @click="goUserysXy">《隐私协议》</view>全文了解详细信息。如您同意，请点击“同意”开始接受我们的服务。
			</view>
			<view class="bottom_btn">
				<view class="b_b_btn" @click="close">暂不使用</view>
				<view class="b_b_btn agree" @click="argees">同意</view>
			</view>
		</div>
		<view class="mask"></view>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				showGuide:false,
			};
		},
		methods:{
			moveHandleStop(){
				
			},
			///隐私协议
			goUserysXy(){
				uni.navigateTo({
					url:'../../pages/xyBooks/xyBooks?xy=10010004&title=隐私协议'
				})
			},
			close(){
				//不同意退出
				plus.runtime.quit();
			},
			argees(){
				this.showGuide = false;
				uni.setStorageSync('ysxy',false);
				uni.showTabBar({});
			}
		},
		mounted(){
			let bol = uni.getStorageSync('ysxy');
			let app = plus.os.name;
			if(bol === '' && app == 'Android'){
				this.showGuide = true;
				uni.hideTabBar({})
			}else{
				this.showGuide = false;
				uni.showTabBar({});
			}
		},
		watch:{
			showGuide:{
				handler(val){
					if(val){
						uni.hideTabBar({})
					}else{
						uni.showTabBar({});
					}
				},
				immediate:true
			}
		}
		
	}
</script>

<style lang="scss" scoped>
	.xyMian{
		z-index: 1001;
		&.mask{
			opacity: 0.0;
		}
		.xyMian_item{
			width: 500rpx;
			border-radius: 12rpx;
			background-color: #fff;
			@include flex_cloumn_center;
			@include box_shandow;
			padding:0 24rpx;
			
			.h1{
				font-size: 34rpx;
				font-weight: bold;
				padding:20rpx 0;
				color: #000;
			}
			.text{
				font-size: 28rpx;
				line-height: 48rpx;
				.xy{
					display: inline;
					color: $ych_font_color;
					text-decoration: underline;
				}
			}
			.bottom_btn{
				width: calc(100% - 80rpx);
				font-size: 32rpx;
				@include flex_align;
				border-top: solid 1px $ych_bg_color;
				padding:24rpx 40rpx;
				margin-top: 30rpx;
				.b_b_btn{
					padding: 0 24rpx;
					&.agree{
						color: $ych_font_color;
					}
				}
			}
		
		}
	}
</style>
